﻿using System.Diagnostics;
using System.IO;

namespace EasyLottery.Utils
{
    class PathUtils
    {
        /// <summary>
        /// 根据相对路劲生成绝对路径
        /// </summary>
        /// <param name="relativePath"></param>
        /// <returns></returns>
        public static string ComposeAbsolutePath(string relativePath)
        {
            var process = Process.GetCurrentProcess();
            var fileName = process.MainModule.FileName;
            var absolutePath = Path.GetDirectoryName(fileName);
            if (absolutePath == null) return null;
            absolutePath = Path.Combine(absolutePath, relativePath);
            return absolutePath;

        }
    }
}
